<script type="text/javascript">
$(document).ready(function(){
    $('#tahun_box').change(function(){
        
       $.ajax({
                type: "POST",
                url: $("#tahun_form").attr('action'),
                data: $("#tahun_form").serialize(),
                success: function(data) {
                            $("select#program_box").html(data);
                            //alert(data);
                }
            });
            return false;
    });
    
    $('#program_box').change(function(){
       $.ajax({
                type: "POST",
                url: $("#program_form").attr('action'),
                data: $("#program_form").serialize(),
                success: function(data) {
                            $("select#box_skim").html(data);
                            //alert(data);
                }
            });
            return false;
    });
    
    $("#box_skim").change(function(){
           document.getElementById("skim_id").value = document.getElementById("box_skim").value;
           //get_map();
    });

});
</script>

<!--tes-->

<!--tes-->


<div class="kontent_box">
    <div class="kontent_panel" >
    <div class="reg_input">
        <h3>Cari Penelitian</h3>
        <table>
            <tr>
                <td style="width: 115px;">Tahun*</td>
                <td>
                     <form id="tahun_form" method="post" action="<?php echo site_url('skim/get_program'); ?>">
                        <select id="tahun_box" name="tahun">
                            <option value="" selected>Pilih Tahun </option>
                                <?php foreach ($data_tahun->result() as $s) { ?>
                                <option value="<?php echo $s->TAHUN_ID;?>" ><?php echo $s->TAHUN_NAMA;?></option>
                                <?php } ?>
                        </select>
                    </form>
                </td>
            </tr>
            <tr>
                <td style="width: 115px;">Program*</td>
                <td>
                     <form id="program_form" method="post" action="<?php echo site_url('skim/get_skim'); ?>">
                        <select id="program_box" name="prog">
                            <option value="" selected>Pilih Program </option>
                        </select>
                    </form>
                </td>        
            </tr>
            <tr>
                <td>SKIM* </td>
                <td>
                    <select id="box_skim" name="skim">
                        <option value="0" selected>Pilih SKIM</option>
                    </select>
                </td>
                <td class="eror_td"><?php echo form_error('skim'); ?></td>
            </tr>
        </table>
        <form method="post" action="<?php echo site_url('admin/list_proposal_baru'); ?>">
        <table> 
            <tr>
                <td style="width: 115px;"></td>
                <td class="eror_td"><?php echo form_error('skim_id'); ?></td>
                <td ><input id="skim_id"  type="hidden" name="skim_id" value="" /></td>       
            </tr>
            <tr>
                <td><input  type="submit" value="Cari" /></td>
                <td class="eror_td"></td>
            </tr>
        </table>
         </form>
    </div>
    </div>